<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        * {
            padding: 0;
            margin: 0;
        }
        #v1 {
            width: 500px;
            height: 500px;
            background-color: #4cae4c;
            position: relative;
        }
        #v2 {

            width: 200px;
            height: 200px;
            background-color: red;
            position: absolute;
            top:150px;
            left:150px;
        }


        /*内边距塌陷wenti*/
        .father {
            width: 400px;
            height: 400px;
            background-color: pink;

            position: relative;
          /*  border-top: 1px solid transparent ;*/

            /* overflow: hidden;  为什么能解决内边距塌陷*/
        }
        .son {
            position: absolute;
            width: 200px;
            height: 200px;
            background-color: red;
            margin-top: 50px;
        }
    </style>
</head>
<body>

<div id="v1">

    <div id="v2"></div>

</div>

<div class="father">
    <div class="son"></div>
</div>
</body>
</html>